import pymysql

class Mysql():
    def __init__(self,host,user,password,port,database):
        self.con = pymysql.connect(host=host,
                                   user=user,
                                   password=password,
                                   database=database,
                                   port=port)
        self.cursor = self.con.cursor()

    def search_sql(self,sql):
        self.cursor.execute(sql)
        return self.cursor.fetchall()

    def close(self):
        self.con.close()
        self.cursor.close()